﻿using EPiServer;
using EPiServer.DynamicContent;

namespace SocialPack.modules.SocialPack.DynamicContent.Facebook
{
    [DynamicContentPlugIn(
        DisplayName = "Facebook Facepile",
        Description = "Displays a Facebook Facepile",
        ViewUrl = "~/modules/socialpack/dynamiccontent/facebook/facepile.ascx")]
    public partial class Facepile : UserControlBase
    {
        public string CountryCode { get; set; }
        public int Width { get; set; }
        public int MaxRows { get; set; }

        protected override void OnLoad(System.EventArgs e)
        {
            base.OnLoad(e);

            if (!string.IsNullOrWhiteSpace(this.CountryCode))
            {
                this.FacepileControl.CountryCode = this.CountryCode;
            }

            this.FacepileControl.Width = this.Width;
            this.FacepileControl.MaxRows = this.MaxRows;
        }
    }
}